package com.peg.exceptions;

/**
 * @author sad
 */
public class ParserException extends RuntimeException {

    private int index = 0;
    private int length = 0;

    public ParserException(String message, int index, int length) {
        super(message);
        this.index = index;
        this.length = length;
    }

    public ParserException(String message, int index) {
        super(message);
        this.index = index;
        length = -1;
    }

    public ParserException(Throwable cause, int index, int length) {
        super(cause);
        this.index = index;
        this.length = length;
    }

    public int getIndex() {
        return index;
    }

    public int getLength() {
        return length;
    }
}
